﻿using ESRI.ArcGIS.ADF.BaseClasses;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using PlanningGIS.Framework;

namespace PlanningGIS.Product
{
    class MdImportLocalCommand:BaseCommand
    {

         private IApplication m_Application;
        public MdImportLocalCommand()
        {
            base.m_caption = "元数据入本地库";
            base.m_toolTip = base.m_caption;
        }

        #region ICommand 成员
        public override void OnCreate(object hook)
        {
            m_Application = hook as IApplication;
        }

        public override void OnClick()
        {
            FrmMdImportLocal frmMdImportLocal = new FrmMdImportLocal(m_Application);
            frmMdImportLocal.Show();
        }

        public override int Bitmap
        {
            get
            {
                string bitmapResourceName = "PlanningGIS.Product.Res." + this.GetType().Name + ".png";
                System.IO.Stream stream = GetType().Assembly.GetManifestResourceStream(bitmapResourceName);
                if (stream == null) return 0;

                return new Bitmap(stream).GetHbitmap().ToInt32();
            }
        }

        public override bool Enabled
        {
            get
            {
                return true;
            }
        }

        #endregion
    }
}
